package main

import "fmt"

//定义一个结构体

type Book struct {
	title string
	auth  string
}

//结构体是值传递
func changebooke(book Book) {
	//这里传递的是Book的副本
	book.title = "666"
}

//指针传递
func changebook(book *Book) {
	book.title = "666"
}
func main() {
	var book1 Book
	book1.title = "Golang"
	book1.auth = "ding"
	changebooke(book1)
	fmt.Print(book1)
	fmt.Printf("%v", book1)
	changebook(&book1)
	fmt.Printf("%v", book1)
}
